from flask import Flask,session
# 集成脚本管理器
from flask_script import Manager
# 集成状态保持的扩展
from flask_session import Session

# 数据库迁移的扩展
from flask_migrate import Migrate,MigrateCommand

# 集成sqlalchemy扩展
from flask_sqlalchemy import SQLAlchemy


from config import Config







# ---------------------------------------------------------------------------
app = Flask(__name__)




# ----------------------------------------------------------------------------
current_config =  Config()
app.config.from_object(current_config)


Session(app)
manage = Manager(app)
            # 创建sqlalchemy对象
db = SQLAlchemy()
Migrate(app,db)
manage.add_command('db',MigrateCommand)












# ---------------------------------------------------------------------------
@app.route('/')
def index():
    session['itcast'] = '2019'
    return 'hello'





# ---------------------------------------------------------------------------
if __name__ == '__main__':
    manage.run()


